<!-- App.vue -->
<template>
  <div id="app">
    <el-container>
      <meta name="referrer" content="no-referrer" />
      <el-aside width="200px" v-show="!(path ==='/') ">
        <!--引入自定义左侧菜单栏-->
        <left-menu></left-menu>
      </el-aside>
      <el-container>
        <el-header v-show="!(path ==='/') ">
          <user-head></user-head>
        </el-header>
        <el-main>
          <!--引入跳转路由-->
          <router-view ></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import UserHead from './views/template/userHead.vue'
import LeftMenu from './views/template/leftMenu.vue'

export default {
  name: 'App',
  data(){
    return{
      path:''
    }
  },
  components: {
    UserHead,
    LeftMenu
  },
  // 判断路由
  mounted() {
    this.path = this.$route.path;
  },
  watch:{
    $route(to,from){
      this.path = to.path
    }
  },
};
</script>

<style>
body {
  background: #f0f0f0;
}
</style>